import { CanvasTexture, Mapping, mappingValues, PixelFormat, pixelFormatValues, TextureDataType, textureDataTypeValues, TextureFilter, textureFilterValues, Wrapping, wrappingValues } from "../../thirdparty/three/imports";
import { Texture3D } from "./Texture3D";

export interface CanvasTexture3D
{
    /**
     * @private
     */
    get _texture(): CanvasTexture;
    set _texture(v);

    /**
     * @private
     */
    __texture: CanvasTexture;
}

export class CanvasTexture3D extends Texture3D
{
    constructor(canvas: TexImageSource, mapping?: Mapping, wrapS?: Wrapping, wrapT?: Wrapping, magFilter?: TextureFilter, minFilter?: TextureFilter, format?: PixelFormat, type?: TextureDataType, anisotropy?: number)
    {
        super();
        this._texture = new CanvasTexture(canvas, mappingValues[mapping], wrappingValues[wrapS], wrappingValues[wrapT], textureFilterValues[magFilter], textureFilterValues[minFilter], pixelFormatValues[format], textureDataTypeValues[type], anisotropy);
    }
}
